<?php

require_once 'core/abstract.db.php';

class account extends db {
	
	private $property = array();
	
	public function __construct()
	{
		$this -> open();
	}
	
	public function getData()
	{
		return $this -> property;
	}
	
	public function setData($query)
	{
		$this -> query($query);
	
			while($rd = $this -> fetch())
			{
				$this -> property[] = $rd;
			}
		return $this;
	}
	
	public function accountTraslateId($id)
	{
		
		$rd = $this -> query("SELECT account_name FROM accounts WHERE account_id = $id") -> fetch();
		
			return $name = $rd['account_name'];
					
	}
	
	public function accountTraslateName($name)
	{
		
		$rd = $this -> query("SELECT account_id FROM accounts WHERE account_name = $name") -> fetch();
		
			return $id = $rd['account_id'];
					
	}
	
}

?>